<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
  <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>导航管理</title>
<link href="../css/mngMain.css" type="text/css" rel="stylesheet" />
<style>
	.searchColor{
		color:blue;
	}
</style>
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript">
       $(function(){
          $("#selectAllBox").click(function(){
      			 $("input[@type=checkbox]",$("#news_table")).each(function(){ 
                      $(this).attr({checked:true});                     
                 });
                 return false;
		  }); //end of allCheck
                   
          $("#deSelectAllBox").click(function(){
      			 $("input[@type=checkbox]",$("#news_table")).each(function(){ 
                      if(this.checked)
                      {
                          $(this).attr({checked:false});
                      }
                      else
                      {
                      	   $(this).attr({checked:true});
                      }              
                 });
                 return false;
		  }); 
		  
		  $("#delSelected").click(function(){
		         var someSelectd = false;
      			 $("input[@type=checkbox]",$("#news_table")).each(function(){ 
                      if(this.checked)
                      {
                          someSelectd=true;
                      }             
                 });
                 if(someSelectd)
                 {
                 	if (confirm('你确认要删吗？')) document.getElementById('newsListForm').submit();
                 }
                 else
                 {
                 	alert('您未选定任何行!');
                 }
                 return false;
		  }); 
        
       });   
</script>
</head>

<body>
<div class="controlBox">
	<%@include file="../admin_top.jsp" %>
	<div class="mngMain">
		<div class="mngLeft">
		 <%@include file="../admin_menu.jsp" %>
		</div>
		<div class="mngRight">
			<div class="mngRightContainer">
				<div class="mngRightContainerT">导航管理</div>
				<div class="mngRightContainerM">
				<font color="red"><bean:write name="info" ignore="true" format=""/></font>
				<html:form action="manageNavigate.do" styleId="newsForm">
					<div class="searchBox">
						<html:text name="navigateSearchForm" property="keyword" /><input type="submit" value="搜索" />
					</div>
					<div class="navBox">选择位置
						<html:select property="type" name="navigateSearchForm" onchange="document.getElementById('newsForm').submit();">
							<html:option value="-1">全部</html:option>
							<html:option value="0">不显示</html:option>
							<html:option value="1">主菜单</html:option>
							<html:option value="2">导航</html:option>
						</html:select>
					</div>	
				</html:form>
					<div> 
					<form id="newsListForm" action="delNavigate.do">
						<table class="editUser" id="news_table" cellpadding="0" cellspacing="1">
							<tr>
								<th width="5%"></th>
								<th width="20%">导航名称</th>
								<th width="20%">导航位置</th>
								<th width="40%">导航链接</th>
								<th width="15%">操作</th>
							</tr>
							<logic:notEmpty name="navigates">
							    <logic:iterate id="na" name="navigates">
								<tr>
									<td><input type="checkbox" name="delId" value="<bean:write name='na' property='id' />"/></td>
									<td class="name">
									<a href="preEditNavigate.do?id=<bean:write name='na' property='id'/>" ><bean:write name="na" property="name"/> </a></td>
									<td>
										<logic:equal name="na" property="type" value="0" >不显示</logic:equal>
										<logic:equal name="na" property="type" value="1" >主菜单第${na.location }位</logic:equal>
										<logic:equal name="na" property="type" value="2" >导航条第${na.location }位</logic:equal>
										
									</td>
									<td>
									${na.url}</td>
									<td><a href="delNavigate.do?delId=<bean:write name="na" property="id" />" onclick="return confirm('你确认要删除吗？')">删除</a><a href="preEditNavigate.do?id=<bean:write name='na' property='id'/>" >编辑</a></td>
																				
								</tr>
								</logic:iterate>	
							</logic:notEmpty>				
						</table>
						</form>
						<table class="changePage" cellspacing="1">
							<tr>
								<td><a href="null#" id="selectAllBox">全选</a><a href="null#" id="deSelectAllBox">反选</a><a href="#" id="delSelected" >删除选中</a></td>							
								<td><bean:write name="page" filter="false"/></td>
							</tr>
						</table>
				</div>
			</div>
			</div>
		</div>
	</div>
	<div class="mngBottom">
		<div class="mngLine"></div>
	</div>
</div>
</body>
</html>